﻿<Window x:Class="XamlHelpmeet.UI.ViewModelCreation.CreateCommandWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:shell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0"
        Background="{DynamicResource {x:Static shell:VsBrushes.ToolWindowBackgroundKey}}"
        BorderBrush="{DynamicResource {x:Static shell:VsBrushes.ToolWindowBorderKey}}"
        Foreground="{DynamicResource {x:Static shell:VsBrushes.ToolWindowTextKey}}"
        Title="Create Command"
        Width="427"
        Height="521.458"
        WindowStartupLocation="CenterScreen">
    <StackPanel>
        <StackPanel.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Left" />
            </Style>
        </StackPanel.Resources>

        <TextBlock Margin="3.5"
                   FontSize="14"
                   FontWeight="Bold"
                   Text="Create ICommand For ViewModel" />

        <CheckBox Margin="3.5"
                  Content="Append Execute to method names"
                  IsChecked="{Binding Path=AutoAppendExecute,
                                      Mode=TwoWay,
                                      UpdateSourceTrigger=PropertyChanged}" />

        <StackPanel Margin="3.5" Orientation="Horizontal">
            <TextBlock Width="150" Text="Command Name" />
            <Grid Margin="7,0">
                <ComboBox x:Name="cboCommandName"
                          Width="217"
                          MaxWidth="217"
                          Focusable="False"
                          Loaded="cboCommandName_Loaded" />
                <TextBox Width="200"
                         Margin="0,0,17,0"
                         Text="{Binding Path=CommandName,
                                        Mode=TwoWay,
                                        UpdateSourceTrigger=LostFocus}" />
            </Grid>
        </StackPanel>

        <StackPanel Margin="3.5" Orientation="Horizontal">
            <TextBlock Width="150" Text="Backing Field" />
            <TextBox Width="200"
                     Margin="7,0"
                     Text="{Binding Path=FieldName,
                                    UpdateSourceTrigger=PropertyChanged}" />
        </StackPanel>

        <StackPanel Margin="3.5" Orientation="Horizontal">
            <TextBlock Width="150" Text="Command Parameter Type" />
            <TextBox Width="200"
                     Margin="7,0"
                     Text="{Binding Path=CommandParameterType,
                                    UpdateSourceTrigger=PropertyChanged}" />
        </StackPanel>

        <GroupBox Margin="3.5">
            <GroupBox.Header>
                <TextBlock FontWeight="Bold" Text="Execute Method" />
            </GroupBox.Header>
            <StackPanel>
                <StackPanel Margin="3.5" Orientation="Horizontal">
                    <TextBlock Width="150" Text="Execute Method Name" />
                    <TextBox Width="200"
                             Margin="7,0"
                             Text="{Binding Path=ExecuteMethodName,
                                            UpdateSourceTrigger=PropertyChanged}" />
                </StackPanel>
                <RadioButton x:Name="rdoExecuteUseAddressOf"
                             Margin="3.5"
                             Content="Use AddressOf"
                             IsChecked="True" />
                <RadioButton x:Name="rdoExecuteUseFunction"
                             Margin="3.5"
                             Content="Use Lamda" />
            </StackPanel>
        </GroupBox>

        <GroupBox Margin="3.5">
            <GroupBox.Header>
                <TextBlock FontWeight="Bold" Text="Can Execute Method" />
            </GroupBox.Header>
            <StackPanel>
                <CheckBox x:Name="chkIncludeCanExecuteMethod"
                          Margin="3.5"
                          Content="Include Can Execute Method"
                          IsChecked="True" />
                <Grid>
                    <StackPanel>
                        <StackPanel Margin="3.5" Orientation="Horizontal">
                            <TextBlock Width="150" Text="Can Execute Method Name" />
                            <TextBox Width="200"
                                     Margin="7,0"
                                     Text="{Binding Path=CanExecuteMethodName,
                                                    UpdateSourceTrigger=PropertyChanged}" />
                        </StackPanel>
                        <RadioButton x:Name="rdoCanExecuteUseAddressOf"
                                     Margin="3.5"
                                     Content="Use AddressOf"
                                     IsChecked="True" />
                        <RadioButton x:Name="rdoCanExecuteUseFunction"
                                     Margin="3.5"
                                     Content="Use Lambda" />
                    </StackPanel>
                    <Border x:Name="bdrCanExecuteNotUsed"
                            Background="LightGray"
                            Visibility="Collapsed">
                        <TextBlock HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   FontWeight="Bold"
                                   Text="Can Execute Not Used" />
                    </Border>
                </Grid>
            </StackPanel>
        </GroupBox>

        <GroupBox Margin="3.5">
            <GroupBox.Header>
                <TextBlock FontWeight="Bold" Text="Command Router" />
            </GroupBox.Header>
            <StackPanel>
                <RadioButton x:Name="rdoRelayCommand"
                             Margin="3.5"
                             Content="RelayCommand"
                             IsChecked="True" />
                <RadioButton x:Name="rdoDelegateCommand"
                             Margin="3.5"
                             Content="DelegateCommand" />
            </StackPanel>
        </GroupBox>

        <StackPanel Margin="3.5"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal">
            <Button Command="{Binding Path=CreateCommand}"
                    Content="Create"
                    Padding="3.5" />
            <Button Margin="7,0"
                    Click="btnCancel_Click"
                    Content="Cancel"
                    Padding="3.5" />
        </StackPanel>

    </StackPanel>
</Window>
